package org.lg.core;

import org.lg.utils.UploadUtil;

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class InitIgnoreMap {
    public static Map<String,String[]> ignoreMap = new HashMap<String,String[]>();
    static {
        try {
        // 获取配置文件数据
        InputStream inputStream = UploadUtil.class.getClassLoader().getResourceAsStream("ignore.properties");
        Properties properties = new Properties();
            properties.load(inputStream);
            // 给属性赋值
            String[] ignorePathArray = properties.getProperty("ignorePath").split(",");
            String[] ignoreExtArray = properties.getProperty("ignoreExt").split(",");
            for(String ignorePath: ignorePathArray){
                ignoreMap.put(ignorePath,ignoreExtArray);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
